System.register(["@angular/http", "ng2-layer", "@angular/core"], function (exports_1, context_1) {
    "use strict";
    var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
        var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
        if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
        else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
        return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    var __metadata = (this && this.__metadata) || function (k, v) {
        if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
    };
    var __moduleName = context_1 && context_1.id;
    var http_1, ng2_layer_1, core_1, OrderComp, _a;
    return {
        setters: [
            function (http_1_1) {
                http_1 = http_1_1;
            },
            function (ng2_layer_1_1) {
                ng2_layer_1 = ng2_layer_1_1;
            },
            function (core_1_1) {
                core_1 = core_1_1;
            }
        ],
        execute: function () {
            OrderComp = (function () {
                function OrderComp(http, layer) {
                    var _this = this;
                    this.http = http;
                    this.layer = layer;
                    this.status = ['', '待发货', '已发货', '确认收货', '交易完成', '已取消'];
                    this.isPay = ['线下', '线上'];
                    this.detailId = -1;
                    this.http.get({
                        search: {
                            m: "Admin",
                            c: "ApiSchool",
                            a: "getOrderList"
                        }
                    }).then(function (data) {
                        _this.orders = data.data;
                    });
                }
                OrderComp.prototype.send = function (order) {
                    this.http.get({
                        message: "提交数据...",
                        search: {
                            m: "Admin",
                            c: "ApiOrder",
                            a: "setOrderDeliver",
                            order_id: order.order_id
                        }
                    }).then(function (data) {
                        order.status = 2;
                    });
                };
                OrderComp.prototype.cancel = function (order) {
                    this.http.get({
                        message: "提交数据...",
                        search: {
                            m: "Admin",
                            c: "ApiOrder",
                            a: "operationOrder",
                            order_id: order.order_id,
                            "do": "cancelOrder "
                        }
                    }).then(function (data) {
                        order.status = 5;
                    });
                };
                return OrderComp;
            }());
            OrderComp = __decorate([
                core_1.Component({
                    templateUrl: "template/router/order.html"
                }),
                __metadata("design:paramtypes", [http_1.Http, typeof (_a = typeof ng2_layer_1.NgLayer !== "undefined" && ng2_layer_1.NgLayer) === "function" && _a || Object])
            ], OrderComp);
            exports_1("OrderComp", OrderComp);
        }
    };
});
